package cate.game.play.buff.h;

import cate.common.table.d.GDBuff;
import cate.game.play.buff.BuffHandler;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;

/**
 * 【诅咒】2回合后受到基于发起者攻击力30%的伤害
 */
public class 诅咒BH extends BuffHandler {

	private double 伤害系数;

	//伤害系数=3000
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		伤害系数 = args.getWDouble("伤害系数", 0d);
	}

	@Override
	public void onInvalid(ActionCtx action, byte invalidReason) {
		if (invalidReason == GDBuff.InvalidReason.EXPIRED) {
			buff.owner.attr.buffHurt(action, buff.caster, buff.caster.attr.attTotal() * 伤害系数);
		}
	}
}
